package com.huiyan.hysys.controller;

import com.huiyan.hysys.bo.SmsCodeBo;
import com.huiyan.hysys.service.intf.SmsService;
import com.huiyan.hysys.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@RequestMapping("/api/sms/")
@CrossOrigin
public class SmsController {

    @Autowired
    private SmsService smsService;
    //发送短信验证码
    @PostMapping("sendcode.do")
    public R sendCode(String phone){
        return smsService.sendCode(phone);
    }
    //发送-登陆短信验证码
    @PostMapping("sendlogincode.do")
    public R sendLoginCode(String phone){
        return smsService.sendCode(phone);
    }
    //校验短信验证码
    @PostMapping("checkcode.do")
    public R checkCode(SmsCodeBo bo){
        return smsService.checkCode(bo);
    }
    //查询短信发送记录
    @GetMapping("all.do")
    public R all(){
        return smsService.all();
    }
}
